package com.niiwoo.civet.trade.dao.mapper;

import com.niiwoo.civet.trade.dao.entity.RefundOrder;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 还款订单表
 * Created by dell on 2018/4/23.
 */
public interface RefundOrderMapperExt extends RefundOrderMapper {

    RefundOrder selectByPrimaryKeyForUpdate(Long refundOrderId);

    int selectInProgressOrderCount(Long projectId);

    RefundOrder selectByBatchNo(String batchNo);

    List<RefundOrder> selectFreezeDealingList();

    List<RefundOrder> selectHandingOver2HoursOrders();

    List<RefundOrder> selectUnFreezeDealingBatch();

    List<RefundOrder> listForInProgress();
    
    List<RefundOrder> listForAccouting();

    List<RefundOrder> listSuccessOrdersByDate(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
    RefundOrder getSuccessRefundOrdersByDate(@Param("startDate") Date startDate, @Param("endDate") Date endDate,@Param("projectId")Long projectId);

    RefundOrder selectByProjectIdAndOrgRequestNo(@Param("projectId") Long projectId, @Param("orgRequestNo") String orgRequestNo);

    RefundOrder selectByOrgRequestNo(@Param("orgRequestNo") String orgRequestNo);

    Byte queryLastRefundTradeSourceByProjectIdAndPeriod(@Param("projectId") Long projectId, @Param("period")Integer period);

    RefundOrder selectByProjectIdAndTradeType(@Param("projectId") Long projectId, @Param("list") List<Byte> tradeTypeList,@Param("currentPeriod")Integer currentPeriod);

}
